import 'package:bxultimate/widgets/mk_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'controller.dart';

import 'package:bxultimate/app/theme/app_theme.dart';
import 'package:bxultimate/app/theme/gaps.dart';
import 'package:bxultimate/widgets/app/app_input.dart';
import 'package:bxultimate/widgets/app/app_title.dart';
import 'package:bxultimate/widgets/app/app_upload.dart';
import 'package:bxultimate/widgets/mk_page.dart';
import 'package:bxultimate/widgets/mk_scroll_view.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart' hide TDInput, TDInputType;

class UserAccountUpdatePasswordPage extends StatefulWidget {
  const UserAccountUpdatePasswordPage({Key? key}) : super(key: key);

  @override
  State<UserAccountUpdatePasswordPage> createState() =>
      _UserAccountUpdatePasswordPageState();
}

class _UserAccountUpdatePasswordPageState
    extends State<UserAccountUpdatePasswordPage> {
  final controller = Get.find<UserAccountUpdatePasswordController>();
  final state = Get.find<UserAccountUpdatePasswordController>().state;

  @override
  Widget build(BuildContext context) {
    return MkPage(
        child: Scaffold(
      backgroundColor: Colors.transparent,
      appBar: TDNavBar(
        backgroundColor: Colors.transparent,
        title: '修改密码',
      ),
      body: Column(
        children: [
          TDInput(
            controller: controller.oldPasswordController,
            leftLabel: '原密码',
            required: true,
            obscureText: true,
            inputType: TextInputType.visiblePassword,
            type: TDInputType.special,
            textAlign: TextAlign.end,
            backgroundColor: Colors.transparent,
          ),
          TDInput(
            controller: controller.newPasswordController,
            leftLabel: '新密码',
            required: true,
            obscureText: true,
            inputType: TextInputType.visiblePassword,
            type: TDInputType.special,
            textAlign: TextAlign.end,
            backgroundColor: Colors.transparent,
          ),
          TDInput(
            controller: controller.confirmPasswordController,
            leftLabel: '确认密码',
            required: true,
            obscureText: true,
            inputType: TextInputType.visiblePassword,
            type: TDInputType.special,
            textAlign: TextAlign.end,
            backgroundColor: Colors.transparent,
          ),
          Gaps.vGap32,
          TDButton(
            text: '保存',
            theme: TDButtonTheme.primary,
            isBlock: true,
          )
        ],
      ),
    ));
  }

  @override
  void dispose() {
    Get.delete<UserAccountUpdatePasswordController>();
    super.dispose();
  }
}
